package com.bingo.rbac.controller;

import com.bingo.rbac.common.ServerResponse;
import com.bingo.rbac.pojo.SysDept;
import com.bingo.rbac.service.SysDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 部门 controller
 *
 * @author bingo
 * @create 2017-12-03 14:20
 **/
@Controller
@RequestMapping("/sysDept")
public class SysDeptController {
    @Autowired
    private SysDeptService sysDeptService;

    @ResponseBody
    @RequestMapping("addDept")
     public ServerResponse  addDept(SysDept sysDept){
        return ServerResponse.createServerResponseBySuccess("增加成功");
     }


    @RequestMapping("/page")
    public String toPage(SysDept sysDept){
        return "sysDept";
    }

    @ResponseBody
    @RequestMapping("/getDeptTree.json")
    public ServerResponse  getDeptTree(){
        return  sysDeptService.getDeptTree();
    }


    @ResponseBody
    @RequestMapping("/getDeptZtree.json")
    public ServerResponse  getDeptZtree(){
        return  sysDeptService.getDeptZtree();
    }

    @ResponseBody
    @RequestMapping("/test.json")
    public String  test(){
        return  "hello";
    }
}
